How to print vertically in a horizontal table

how to print excel horizontally
how to print horizontally in word
html table vertical and horizontal header
excel portrait and landscape in same sheet
horizontal table bootstrap
how to rotate excel sheet for printing
change text direction in table word 2016 mac
bootstrap vertical table-responsive

so im making a program and one of the the things im trying to do is print a table of converted ASCII Characters like this

 DEC HEX OCT  DEC HEX OCT  DEC HEX OCT  DEC HEX OCT
A 65 101 25 C 66 111 232  E 12 32  12  G 21 56  12
B 12 89 23  D 45 124  23  F 34 123 10  H 89 203 8

i have done the conversion part of the program i just need a bit of help getting the table to print the right way

anyone have any suggestions?

my code

public static void getInputs(String[] args) {
    //c1, c2, and c3 are the characters the user enters
    //selector is what determends how the method will print

    char c1 = args[0].charAt(0);
    char c2 = args[1].charAt(0);
    char c3 = args[2].charAt(0);
    int letter1 = (int) c1;
    int letter2 = (int) c2;
    String selector = Character.toString(c3);
    char[] arr;
    int index = 0;
    arr = new char[c2 - c1 + 1];
    //Yif the selector is the letter h the program will print horizontaly     
    //Xif the selector is the letter v the program will print vertically 
    //Yprogram prints horizontaly
    //Xprogram prints vertically
    //Yselector works
    //Xclean up everything

    if (letter2 >= letter1){
    if (selector.equals("h")) {
            //(char)x is the letter
            //x is the number
            int counter = 0;
            for (int x = (int) c1; x <= c2 && counter < 4; ++x) {

                System.out.print("     " + "DEC " + "Oct " + "Hex");
                ++counter;
            }
            System.out.println("\n");
            for (int x = (int) c1; x <= c2; ++x) {
                if (counter % 4 == 0) {
                    System.out.println("");
                }

                String hex = Integer.toHexString(x);
                String oct = Integer.toOctalString(x);
                arr[index++] = (char) x;
                System.out.print("   " + (char) x + "  "
                        + x + " " + oct + "  " + hex);
                ++counter;
            }
            pause();
        } else if (selector.equals("v")) {


         int counter = 0;
            for (int x = (int) c1; x <= c2 && counter < 4; ++x) {

                System.out.print("     " + "DEC " + "Oct " + "Hex");
                ++counter;
            }
            System.out.println("\n");
            for (int x = (int) c1; x <= c2; ++x) {
                if (counter % 4 == 0) {
                    System.out.println("");
                }

                String hex = Integer.toHexString(x);
                String oct = Integer.toOctalString(x);
                arr[index++] = (char) x;
                System.out.print("   " + (char) x + "  "
                        + x + " " + oct + "  " + hex + "\n");
                ++counter;
            }
            pause();




        } else {
            System.out.println("Error: Third input parameter must be h or v.");
            System.out.println("Program now terminating.");
            //?insert pause and end the program here
        }
    }else{
    System.out.println("Error: First input parameter must precede "
    + "the second in the ASCII sequence.");
    }

}

i know my code is a bit of a mess and you can put stuff in methods but right now im just focusing on getting the table to print properly.

also i apologize for the bad name for my question.


Print the values separated by tabs. Taken from your code snippet

HEADER:

            System.out.print("     " + "\t\tDEC " + "\t\tOct " + "\t\tHex");
            ++counter;
        }

VALUES:

            System.out.print("   " + (char) x + "\t\t"
                    + x + "\t\t" + oct + "\t\t" + hex);
            ++counter;
        }

How to Create Vertical Headings in Excel, How do I make a vertical header in a table? Click “Vertical Text” in the drop-down list to convert from horizontal to stacked vertical orientation. Highlight the headings. Right-click, click “Format Cells,” and click the “Alignment” tab in the Format Cells dialog box. Type “-90” for a clockwise rotation or “90” for a counterclockwise rotation in the Degrees box in the


I'm not going to show how to modify your code to print sequence of values in horizontal and vertical order, but instead show you a more generic implementation for simply printing numbers like that, so the answer to more generally useful to other people too.

I'll leave it up to you to apply the algorithm to your code.

public static void printHorizontal(int min, int max, int cols) {
    for (int i = min; i <= max; i++) {
        boolean last = (i == max || (i - min + 1) % cols == 0);

        System.out.printf("%3d", i);
        if (last)
            System.out.println();
        else
            System.out.print("  ");
    }
}
public static void printVertical(int min, int max, int cols) {
    int rows = (max - min) / cols + 1;
    for (int row = 0; row < rows; row++) {
        for (int col = 0, i = min + row; col < cols && i <= max; col++, i += rows) {
            boolean last = (col == cols - 1 || i > max - rows);

            System.out.printf("%3d", i);
            if (last)
                System.out.println();
            else
                System.out.print("  ");
        }
    }
}

Tests

printHorizontal(5, 17, 5);
printVertical(5, 17, 5);

Outputs

  5    6    7    8    9
 10   11   12   13   14
 15   16   17
  5    8   11   14   17
  6    9   12   15
  7   10   13   16

How to print an Excel file horizontally, Sometimes you need to print a document in Excel but instead of a vertical orientation, you want your cells to be spread horizontally over your print sheet. First, highlight the text you want to align vertically. Once selected, head back to the “Layout” tab of the “Page Setup” dialog box. Next, choose the desired vertical alignment type, open the drop-down menu next to “Apply To,” select “Selected text,” and then click the “OK” button.


Use System.out.printf(String, ....) and it will get much easier - you can specify item as follows:

System.out.printf("%c %3d %03o %3x %c %3d %03o %x %c %3d %03o %3x\n", 
    'a', (int)'a', (int)'a', (int)'a', 
    'b', (int)'b', (int)'b', (int)'b', 
    'c', (int)'c', (int)'c', (int)'c');

Which gets you

a  97 141  61 b  98 142 62 c  99 143  63

Horizontal/Vertical table headings, table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } </style> </head> <body> ​ <h2>Horizontal Headings:</h2> With the Transpose function, you can convert vertical list to horizontal or vice versa as follows. 1. Select a vertical list or horizontal list you want to convert, and then press Ctrl + C keys simultaneously to copy the list. 2. Select a blank cell which you want to locate the converted list.


Print horizontal or vertical pages using Acrobat or Reader, Print PDF pages, print vertical PDF pages, change PDF page orientation while printing, and rotate PDF pages when printing using Acrobat. The naive method can be used to print the list vertically vis. using the loops and printing each index element of each list successively will help us achieve this task. # Python3 code to demonstrate. # Vertical list print. # using naive method. # initializing list. test_list = [ [1, 4, 5], [4, 6, 8], [8, 3, 10]] # printing original list.


Changing Table Cell Text Direction (Microsoft Word), For instance, you may want the text to be vertical instead of horizontal. You can change text direction by following these steps: Right-click your  Convert horizontal to vertical with Paste Special. In Excel, you can use the Paste Special to convert a horizontal list to a vertical list. 1. Select the row data and press Ctrl + C to copy it. See screenshot: 2. Click at a cell you want to output the result, and right click to open context menu, click Paste Special > Transpose in Excel 2010 and 2013. See screenshot:


Dynamically creating a horizontal table with vertical columns, I need a horizontal table to be created where the title of category sits at the top of Dynamically creating a horizontal table with vertical columns <h3 style="float:​left; display:inline-block; color:#FFFFFF; line-height:22px;"><a href="index.php? Vertically Align Part of a Word Document. Go to the Layout tab (or Page Layout , depending on the version of Word). In the Page Setup group, select the Page Setup dialog launcher (which is located in the lower-right corner of the group). In the Page Setup dialog box, choose the Layout tab. In the