Ok....This is MMA 12.2 -- I've been on this for some days now. Not hardcore time spent, but I've put in quite a few hours and am making no progress now.

It's just a project for myself mostly, but I do intend to actually use it for work-related purposes.

My goal is to populate a nicely formatted 'table','grid' with all the trig functions including the hyperbolics so I can change the angle and have the 'table/grid' update with the results.

I have gone through the documentation, SE, and so on and nothing seems to be working.

One thing I did find out is using "Dataset" gives results in decimals, and "Grid" gives the exact results (as you see in this post), which I don't understand even a little bit, but I do like having both, but that's a question for another day.

I'd just like to be able to make the whole 'table nice looking and formatted well. Be able to make the text (contents of the grid) larger or smaller, change text color, and background color.

What you see is the best I've come up with. It's not horrible, but it's not great either.

Anyone have some ideas, suggestions for this, please?

Thank you....I always learn things when I come in here. There's nothing golden about how I've done the code. I was just trying to put things together to get a result.

Here's the code:

angle = 45;
convert = Pi/180;
data = {
     {"\[Theta]", angle},
   {"Sin[\[Theta]] ", Sin[angle*convert]},
   {"Cos[\[Theta]] ", Cos[angle*convert]},
   {"Tan[\[Theta]] ", Tan[angle*convert]},
   {"Csc[\[Theta]] ", Csc[angle*convert]},
   {"Sec[\[Theta]] ", Sec[angle*convert]},
   {"Cot[\[Theta]] ", Cot[angle*convert]}
Grid[data, Alignment -> Center, Spacings -> {2, 2}, Dividers -> All, 
 ItemSize -> 12, ItemStyle -> Blue, 
 Background -> {{LightPink, LightGray}}]

snapshot This is what it looks like on my end.

  • 1
    $\begingroup$ 1) Have you heard of N? That turns exact numbers into inexact numerical values. 2) you don't need to multiply by convert - a constant you've defined yourself - you could write angle Degree instead $\endgroup$
    – flinty
    Apr 28, 2021 at 20:32
  • 1
    $\begingroup$ The text and background colour are up to you - you've already chosen LightPink and LightGray so just change those. You could also experiment with the frame FrameStyle -> Directive[GrayLevel[.5], Thick] . For the text size and colour, try ItemSize -> 12, ItemStyle -> Directive[Purple, FontSize -> 18, FontWeight -> Bold] $\endgroup$
    – flinty
    Apr 28, 2021 at 20:39
  • 1
    $\begingroup$ You might like to enshroud this in a Manipulate that lets you change the angle! $\endgroup$
    – thorimur
    Apr 28, 2021 at 22:14
  • $\begingroup$ flinty --- Yes I've heard of "N", but I'm ok with the radical form. I am ok getting the decimal form, I just didn't understand why using Grid gives the radical form and Dataset gives decimals. I tried your suggestion verbatim: "FrameStyle -> Directive[GrayLevel[.5], Thick] . For the text size and colour, try ItemSize -> 12, ItemStyle -> Directive[Purple, FontSize -> 18, FontWeight -> Bold]" and no change in the appearance of the output at all & I don't understand that either. Changing those metrics don't seem to effect any change at all in the output. I evaluate the entire notebook & nothing. $\endgroup$
    – fiz
    Apr 29, 2021 at 15:08
  • $\begingroup$ thorimur --- I did think about that, and I may, but I wanted to get the output looking the way I want first, but great suggestion, thank you. $\endgroup$
    – fiz
    Apr 29, 2021 at 15:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.