For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
paulp575
Rank IV - Intermediate
Posts: 170 Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Post
by paulp575 » Fri Jul 30, 2021 11:52 pm
How would I write this for a style sheet:
Code: Select all
<tr><th style="border-right:1.4em solid #228B22">2021</th></tr>
I've tried a variety of BORDER-WIDTH-RIGHT and included a color, but nothing is working. It's either nothing or the color covers the text.
Thanks.
Last edited by paulp575 on Thu Aug 12, 2021 11:18 pm, edited 4 times in total.
paulp575
Albert Wiersch
Site Admin
Posts: 3785 Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Post
by Albert Wiersch » Sat Jul 31, 2021 12:42 am
I'm not sure I understand the question but perhaps you are simply wanting something like this?
Code: Select all
th { border-right:1.4em solid #228B22; }
paulp575
Rank IV - Intermediate
Posts: 170 Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Post
by paulp575 » Sat Jul 31, 2021 12:25 pm
Again - that worked.
Thanks.
paulp575
paulp575
Rank IV - Intermediate
Posts: 170 Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Post
by paulp575 » Sat Jul 31, 2021 11:15 pm
Not working because I didn't provide all the details.
Let's try again - sorry.
Here's the original code:
Code: Select all
<tr>
<th style="border-right:1.4em solid #0BDA51">(year)</th>
<td>Green Text here</td>
</tr>
<tr>
<th style="border-right:1.4em solid #ff0000">(year)</th>
</tr>
Note: The second row which is red has no text (some red rows MAY have text).
I'm thinking I need to use the id selector?
The end result would be one line with the year in black (default color) and a green box to the right of the year and then some black text to the right of the green box.
The next line with the year in black (again, default color) and a red box to the right of the year and then some black text to the right of the red box.
Not all lines will have text, but that should be easy to figure out - maybe.
Thanks.
paulp575
Albert Wiersch
Site Admin
Posts: 3785 Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Post
by Albert Wiersch » Mon Aug 02, 2021 12:11 am
If I am understanding correctly, it sounds like you should use class selectors.
Like this CSS:
Code: Select all
th.greenbox { border-right:1.4em solid #0BDA51; }
th.redbox { border-right:1.4em solid #ff0000; }
With this HTML:
Code: Select all
<table>
<tr>
<th class="greenbox">(year)</th>
<td>Green Text here</td>
</tr>
<tr>
<th class="redbox">(year)</th>
</tr>
</table>
Does this do what you want?
paulp575
Rank IV - Intermediate
Posts: 170 Joined: Tue Aug 09, 2005 1:20 pm
Location: Spokane WA
Post
by paulp575 » Mon Aug 02, 2021 2:00 am
I figured out a different way to make this happen, but will save your code for future use.
paulp575