- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
You can turn a table with 4 columns in a table from 2 columns using a new external css? without adding new code in html page
Start:
<table>
<tr><td></td><td></td><td></td><td></td></tr>
</table>
Result:
<table>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
If you are asking if it’s possible (it’s not clear) with CSS, then the answer is NO.
CSS can only style HTML not create new elements.
Also, if you think about it logically this would destroy the reason for using a table in the first place.
You are using it to display tabular data aren’t you?
sorry for my english
with this code transform a table of 4 columns in a table by 1 column only, but I need 2 columns
In your original post you say “without adding new code to the HTML page” but in your Start and Result code examples, there IS new code…so that’s a little contradictory.
Having said that, you could do something like this, but that may not be in the order you like to see the cells:
My example was wrong sorry.
the data in my table so in alphabetical order
<tr>
<td>a</td><td>b</td><td>c</td><td>d</td>
</tr>
<tr>
<td>e</td><td>f</td><td>g</td><td>h</td>
</tr>
I have 500 tables can not change code, are desperate!
Something like this then?
fantastic work!
last problem, some cells of the table are empty, how can I display only the border?
<td>A</td><td>B</td>
<td>C</td><td> </td>
you can delete the blank cells without leaving empty space ?