/    Sign up×
Community /Pin to ProfileBookmark

Two Table Columns Equal Width

I’ve got an HTML table. Multiple columns. But two are comparing the same type of data. My table width is 100% of the container and depending on what table it is I’ve got numerous other columns.

The TD and TH are all auto based on the content and it works fine.

I do however have these two columns which have comparable data. I want the column widths to be the same

I’ve made a default of 100px each which works but when one is extended due to a longer text string I want the other to expand to match it.

I’m sure there’ll be some JavaScript magic out there but I can’t find anything with a google search. Has anyone seen this done or got any ideas

I’ve got text wrap disabled as I want the row heights to remain equal.

to post a comment
HTMLJavaScript

0Be the first to comment 😎

×

Success!

Help @kiwis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 3.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,

tipper: Anonymous,
tipped: article
amount: 10 SATS,
)...