Tafalezono Posted May 20, 2014 Share Posted May 20, 2014 Hi, I've got a table looking something like this: <table> <tr> <th scope="row">Heading1</th> <td>Content</td> </tr> <tr> <th scope="row">Heading2</th> <td>Content</td> </tr> <tr> <th scope="row">Heading3</th> <td>Content</td> </tr> </table> I would like the content to be displayed below the headings by only updating the style sheet. Is this possible? Link to comment Share on other sites More sharing options...
0 +virtorio MVC Posted May 20, 2014 MVC Share Posted May 20, 2014 You could do some convoluted absolute positioning to force the locations of the cells, but you're really not using it right. This is how <th> supposed to be used to do what you want: <table border width="200"> <tr> <th>header cell 1</th> <th>header cell 2</th> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> Source: http://webdesign.about.com/od/htmltags/p/bltags_th.htm Starbuck84 1 Share Link to comment Share on other sites More sharing options...
0 Starbuck84 Posted May 20, 2014 Share Posted May 20, 2014 (edited) Not that I know of, but you're now defining a table row which contains a heading and data. You'll need a row with headings, and a row with data. Something like this: <table> <tr> <th scope="row">Heading1</th> <th scope="row">Heading2</th> <th scope="row">Heading3</th> </tr> <tr> <td>Content 1</td> <td>Content 2</td> <td>Content 3</td> </tr> </table> Link to comment Share on other sites More sharing options...
0 Tafalezono Posted May 20, 2014 Author Share Posted May 20, 2014 You could do some convoluted absolute positioning to force the locations of the cells I am not allowed to make any changes to the html structure of the page, but can however make css changes. How could this be done by using convoluted absolute positioning? Link to comment Share on other sites More sharing options...
0 Tafalezono Posted May 20, 2014 Author Share Posted May 20, 2014 I figured it out myself. One can just use: th, td { display:block; } Link to comment Share on other sites More sharing options...
0 Seahorsepip Veteran Posted May 20, 2014 Veteran Share Posted May 20, 2014 Yeah tr float left and tr,td&th display block should do it Link to comment Share on other sites More sharing options...
Question
Tafalezono
Hi, I've got a table looking something like this:
I would like the content to be displayed below the headings by only updating the style sheet. Is this possible?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts