wet-boew / wet-boew-styleguide

A style guide for the Web Experience Toolkit.
http://wet-boew.github.io/wet-boew-styleguide/index-en.html
36 stars 32 forks source link

Tables - colgroup and text-right, text-center alignment #251

Closed suzanneIRB closed 9 years ago

suzanneIRB commented 9 years ago

We use <colgroup> (and <col>) to align numbers to the right in the cell of our financial tables rather than code each cell to the right. However, when applying the WET4 class "text-right", "text-center", it does not work. Can the tag <col> be added to the existing classes "text-right" & "text-center" so that it will work?

Alternately, is there a table class designed to align the cells to the right or center?

pjackson28 commented 9 years ago

It is not an issue with WET or Bootstrap, it is an issue with the W3C (and by extension browsers) only supporting four CSS properties on the col element, which text-align is not one of them. There used to be an align attribute supported on col but it has since been deprecated in HTML5. So there is nothing that can be done on our end until the W3C and browsers decide to support CSS alignment through the col element.

You can read a discussion about this here: http://stackoverflow.com/questions/1119106/why-is-styling-table-columns-not-allowed

pjackson28 commented 9 years ago

Note also that you can apply "text-right" to the table element and the tr element and it will change the alignment for all td elements. If you want to change the alignment of th elements, then you will need to apply "text-right" to the th elements individually.

suzanneIRB commented 9 years ago

Thank you for all the prompt responses.

Bonne journée / Have a nice day Suzanne Burbidge

Agente de soutien du Web Commission de l'immigration et du statut de réfugié du Canada / Gouvernement du Canada suzanne.burbidge@cisr-irb.gc.camailto:suzanne.burbidge@cisr-irb.gc.ca Tél. lundi, mercredi & vendredi: 613-769-9006 • mardi & jeudi : 613-834-9957 Télécopieur : 613-996-0270 Twitter : @CISR_Canada

Web Support Officer Immigration and Refugee Board of Canada / Government of Canada suzanne.burbidge@irb-cisr.gc.camailto:suzanne.burbidge@irb-cisr.gc.ca Tel. Monday, Wednesday & Friday: 613-769-9006 • Tuesday & Thursday: 613-834-9957 Fax: 613-996-0270 Twitter: @IRB_Canada [cid:image001.jpg@01D0B010.BACA9BB0]

From: Paul Jackson [mailto:notifications@github.com] Sent: June 26, 2015 12:37 PM To: wet-boew/wet-boew-styleguide Cc: Burbidge, Suzanne Subject: Re: [wet-boew-styleguide] Tables - colgroup and text-right, text-center alignment (#251)

Note also that you can apply "text-right" to the table element and the tr element and it will change the alignment for all td elements. If you want to change the alignment of th elements, then you will need to apply "text-right" to the th elements individually.

— Reply to this email directly or view it on GitHubhttps://github.com/wet-boew/wet-boew-styleguide/issues/251#issuecomment-115748572.

* This E-mail is sent from the Immigration and Refugee Board of Canada. As this message may contain confidential information, if you are not the intended recipient, please delete the E-mail and notify the sender. / Ce courriel a été envoyé par la Commission de l'immigration et du statut de réfugié du Canada. Il pourrait contenir des renseignements confidentiels; s'il vous est parvenu par erreur, veuillez le supprimer et aviser l'expéditeur immédiatement. *