Ask Your Question
0

Bold in table

asked 2022-11-18 14:47:52 +0100

Cyrille gravatar image

updated 2022-11-20 18:27:30 +0100

For the following code

list_collab = ["A_0", "I_0", "E_0", "A_1", "I_1", "E_1"]
collab = set(list_collab)
show(list_collab)
subcollab = Subsets(collab,3,submultiset=True)
show(list(subcollab))
affinites= [[ZZ.random_element(1,5) for i in range(0,5)] for j in range(0,4)]
#show(list_collab)
list_collab1 = ['']+list_collab[0:]
list_collab2 = [r'<b style="color:black">$'+x+r'$</b>' for x in list_collab1]
table_aff =table(affinites, header_row=list_collab, header_column=list_collab2)
show(table_aff)

No strong problem with the table if I can have indexed values in header rows.

edit retag flag offensive close merge delete

Comments

And your question is ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-11-18 18:20:43 +0100 )edit

Yes a question would be nice, but if you run this little program you will see there is a un the first cell.

Cyrille gravatar imageCyrille ( 2022-11-19 15:32:29 +0100 )edit

First, it would help if you provided a minimal example that demonstrated the problem. For example, remove all lines involving the variable collab from this altogether.

John Palmieri gravatar imageJohn Palmieri ( 2022-11-19 19:30:38 +0100 )edit

Second, it looks a lot better if I change list_collab2 to ... for x in list_collab rather than for x in list_collab1: list_collab1 has an empty first entry.

John Palmieri gravatar imageJohn Palmieri ( 2022-11-19 19:31:45 +0100 )edit

Finally, is the * at the end intentional?

John Palmieri gravatar imageJohn Palmieri ( 2022-11-19 19:32:19 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-11-22 20:34:39 +0100

With your code, I get this output: image description

If I make two changes — namely, changing the definition of affinites to use for i in range(0,6) and changing the definition of list_collab2 to use for x in list_collab — then I get this: image description

It is not clear what you are hoping to get, but the second version certainly looks better than the first one.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-11-18 14:47:52 +0100

Seen: 57 times

Last updated: Nov 22