I have the following html code:
<table border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td rowspan="2">Save a lot</td> </tr> <tr> <td>March</td> </tr> </table>
Using CSS styling or another method, can I make the text "Save a lot" top, left justified?
you just need to specify the height of the span , the same with the td element that contain it, set the width:100% so there won't be another inline element beside it, and set display:inline-block so the width and height can work.
HTML | <td> align Attribute left: It sets the text left-align. right: It sets the text right-align. center: It sets the text center-align. justify: It stretches the text of paragraph to set the width of all lines equal.
td[rowspan] { vertical-align: top; text-align: left; }
See: CSS attribute selectors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With