HXTABLETRANS(1)

✨ hxtabletrans ✨

okay bestie, so this is hxtabletrans, and it lives in the HTML-XML-utils family πŸ’– it's the little icon that flips your tables so you don't have to do it by hand like a Victorian child. sit down, grab a strawberry πŸ“, let's go.


🌸 SYNOPSIS 🌸

hxtabletrans [ -c ] [ -x ] [ -v ] [ file-or-URL ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe. hxtabletrans reads an HTML or XHTML file β€” and yes, a fragment counts too, we're not picky β€” finds the first <table> element in there, and then prints that element back out with the rows and columns transposed. rows become columns. columns become rows. it's giving rotation. it's giving main character geometry ✨

now the sad part 😭 any grouping of rows you had going on with <thead>, <tbody> or <tfoot>? lost. gone. not surviving the flip. also, any comments that live outside the cells get dropped too. rip to those, fr fr πŸ’€


πŸ’… OPTIONS πŸ’…

here's what you can hand her:

  • -c β€” this one's lowkey the cutest. it also tries to transpose the contents of the cells. so if a cell is made up of nothing but horizontal or vertical arrows and ellipses (mark-up and whitespace don't count, they're just vibing in the background), then those arrows and ellipses get swapped for their transposed counterparts. like, a right arrow becomes a down arrow. obsessed 🫢
  • -x β€” XML syntax mode, bestie. empty elements get written with a slash (/) at the end, e.g.: <br/>
  • -v β€” prints the version number and then dips. exit, stage left πŸ‘‘

πŸ’€ BUGS πŸ’€

okay so we have to be honest here, no cap. hxtabletrans should check for rows that have fewer cells than the longest row β€” and yes, that means taking into account the effect of the colspan and rowspan attributes β€” and it should create the omitted cells. but it currently doesn't. so tables with rows of unequal length may not get transposed correctly. that's just the reality of it πŸ™ˆ

also: nested tables are not transposed. not even a little. periodt.


🌈 SEE ALSO 🌈

(nothing extra here, she's an independent queen πŸ’œ)


and that's the whole page, bestie! this one's from the HTML-XML-utils crew, running version 7.x, dated 10 Jul 2011 πŸŽ€ β€” oldie but a goodie, and honestly? iconic. go transpose something. slay πŸ’…βœ¨